#include <stdio.h>
#include "msg_queue.h"
#include <string.h>

int main(int argc, char const *argv[])
{
    struct Msg msg;
    int id = msg_queue_init(MSG_QUEUE_NAME);
    msg.msg_type = MSG_QUEUE_TYPE;

    while(1)
    {

        scanf("%s", msg.buf);
        msg.buf[strlen(msg.buf)] = '\0';

        if(msg_queue_send(id, (void*)&msg, sizeof(msg.buf), 0) == -1)
        {
            printf("send msg_queue error!\n");
        }
        printf("[msq] : write success\n");

    }
    
    return 0;
}
